package com.atguigu.mybatis.mapper;

import com.atguigu.mybatis.pojo.Student;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author lhl
 * @date 2025/4/23 15:57
 */
public interface DynamicSQLMapper {

    /**
     * 多条件查询
     */
    List<Student> selectStudentByCondition(Student student);

    /**
     * 多条件查询where+if
     * @param student
     * @return
     */
    List<Student> selectStudentByWhere(Student student);

    /**
     * 多条件查询where+trim
     * @param student
     * @return
     */
    List<Student> selectStudentByTrim(Student student);

    /**
     * 多条件查询where+choose
     * @param student
     * @return
     */
    List<Student> selectStudentByChoose(Student student);


    /**
     * 根据id，批量删除学生信息
     */
    Integer deleteMoreByIds(@Param("ids") Integer[] ids);

    /**
     * 批量添加学生信息
     */
    Integer insertMoreStudent(@Param("studentList") List<Student> studentList);
}
